package pro.model.tests;

import java.awt.*;
import junit.framework.TestCase;
import pro.model.core.*;

/**
 * @author  sangwo.y
 */
public class CardTest extends TestCase {
	
	private Card KH;
	private Card AH;
	private Card QH;
	private Card KD;
	private Card TenS;
	private Card JH;
	
	protected void setUp() throws Exception {
		super.setUp();
		KH = new Card(Card.Suit.Heart, Card.Value.King);
		AH = new Card(Card.Suit.Heart, Card.Value.Ace);
		QH = new Card(Card.Suit.Heart, Card.Value.Queen);
		KD = new Card(Card.Suit.Diamond, Card.Value.King);
		JH = new Card(Card.Suit.Heart, Card.Value.Jack);
		TenS = new Card(Card.Suit.Spade, Card.Value.Ten);
	}
	
	public CardTest(String name) {
		super(name);
	}
	
	public void testGetSuit() {
		assertEquals("testGetSuit Failed", Card.Suit.Heart, KH.getSuit());
	}
	
	public void testGetValue() {
		assertEquals("testGetSuit Failed", Card.Value.King, KH.getValue());
	}
	
	public void testGetColor() {
		//System.out.println(KH);
		assertEquals("testGetColor Failed", KH.getColor(), Color.RED);
		//System.out.println(TenS);
		assertEquals("testGetColor Failed", TenS.getColor(), Color.BLACK);		
	}
	
	public void testIsNext() {
		assertFalse("testIsNext Failed", AH.isNext(KH));
		assertFalse("testIsNext Failed", KH.isNext(QH));
		assertFalse("testIsNext Failed", AH.isNext(KD));
		assertTrue("testIsNext Failed", JH.isNext(TenS));
		
	}
}
